package org.adream.account.util;

import org.springframework.web.servlet.ModelAndView;

/**
 * 便捷创建mv
 * @author chenhaoyu
 *
 */
public class PageUtil {

	/**
	 * pc端跳转错误页面
	 * @param errorInfo
	 * @return
	 */
	public static ModelAndView errorPage(String errorInfo){
		ModelAndView error = new ModelAndView("error");
		error.getModel().put("error_info", errorInfo);
		return error;
	}
	
	/**
	 * pc端跳转成功页面
	 * @param info
	 * @return
	 */
	public static ModelAndView successPage(String info){
		ModelAndView success = new ModelAndView("success");
		success.getModel().put("success_info", info);
		return success;
	}
	
	/**
	 *移动端跳转错误页面
	 * @param errorInfo
	 * @return
	 */
	public static ModelAndView appErrorPage(String errorInfo) {
		ModelAndView error = new ModelAndView("appError");
		error.getModel().put("error_info", errorInfo);
		return error;
	}
	
	/**
	 * 移动端跳转成功页面
	 * @param info
	 * @return
	 */
	public static ModelAndView appSuccessPage(String info) {
		ModelAndView success = new ModelAndView("appSuccess");
		success.getModel().put("success_info", info);
		return success;
	}	
}